﻿@using WebAPP_LIULI.Models;
@{
    List<MidSendOrder> modelList = Model;
}

<!-- Page-Title -->
<div class="row">
    <div class="col-sm-12">
        @*<div class="btn-group pull-right m-t-20">
            
            <a href="/Home/OrderInput" class="btn btn-success btn-md waves-effect waves-light m-b-30"><i class="md md-add"></i>添加</a>
        </div>*@
        <h4 class="page-title">发货列表</h4>
    </div>
</div>

@*<div class="row">
    <div class="col-12">
        <div class="form-group form-inline">
            <label class="col-2 col-form-label">交货日期</label>
            <div class="col-5">
                <input class="form-control" type="date" id="DeliveryStartTime" name="DeliveryStartTime" placeholder="开始时间" value="">

            </div>
            <div class="col-5">
                <input class="form-control" type="date" id="DeliveryEndTime" name="DeliveryEndTime" placeholder="结束时间" value="">

            </div>
            <div class="col-5">
                <button id="queryButton" type="button" class="btn btn-primary btn-md waves-effect waves-light"><i class="md md-add"></i>查询</button>
            </div>
        </div>
    </div>
</div>*@
<!-- end page title end breadcrumb -->


<div class="row">

    <div class="col-12">
        @foreach (var m in modelList)
        {
            <div class="card-box">
                <dl class="row">
                    <dt class="col-6">顾客名称</dt>
                    <dd class="col-6">@m.Order.Customer.CustomerName</dd>
                    <dt class="col-6">公司识别号</dt>
                    <dd class="col-6">@m.Order.Customer.CustomerCompanyNumber</dd>
                    <dt class="col-6">顾客地址</dt>
                    <dd class="col-6">@m.Order.Customer.CustomerAddress</dd>
                    <dt class="col-6">产品名称</dt>
                    <dd class="col-6">@m.Order.ProductName</dd>
                    <dt class="col-6">订单数量/吨</dt>
                    <dd class="col-6">@m.Order.ProductCount 吨</dd>
                    <dt class="col-6">交货日期</dt>
                    <dd class="col-6">@m.Order.DeliveryTime</dd>
                    <dt class="col-6">订单状态</dt>
                    <dd class="col-6">@m.Order.OrderStatus</dd>
                    <dt class="col-6">销售人员</dt>
                    <dd class="col-6">@m.Order.Salesman</dd>
                    <dt class="col-6">订单日期</dt>
                    <dd class="col-6">@m.Order.CreateTime</dd>
                    <dt class="col-6">订单发货量</dt>
                    <dd class="col-6">@m.Order.DeliveryCount</dd>
                    <dt class="col-6">发货单发货量</dt>
                    <dd class="col-6">@m.SendCount</dd>
                    <dt class="col-6">剩余发货量</dt>
                    <dd class="col-6">@(m.SendCount - m.ReceiveCount)</dd>
                </dl>
                @*<a href="/Home/OrderInput?id=@m.Id" class="btn btn-block btn-xs btn-purple waves-effect waves-light">操作</a>*@
                @if(m.TaskStatus == "部分发货" || m.TaskStatus == "准备发货")
                {
                    <a href="/Home/SendOrder?id=@m.Id" class="btn btn-block btn-xs btn-success waves-effect waves-light">发货</a>
                }
                
            </div>
        }

    </div><!-- end col -->

    <script>
        $(document).ready(function () {

            $('#queryButton').click(function () {
                var starttime = $('#DeliveryStartTime').val();
                var endtime = $('#DeliveryEndTime').val();
                window.location = '/Home/OrderList?starttime=' + starttime + '&endtime=' + endtime;
            })
        });
    </script>

</div>
<!-- end row -->